﻿using System;
using System.Web.Services;
using MonkeyShop.Admin.Biz;

namespace MonkeyShop.Web.Administration.Categories
{
    public partial class List : System.Web.UI.Page
    {
        #region Properties

        private static AdminCategoryBiz _adminCategoryBiz;
        private static AdminCategoryBiz AdminCategoryManager {
            get { return _adminCategoryBiz ?? (_adminCategoryBiz = new AdminCategoryBiz()); }
        }

        #endregion
        
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #region WebMethods

        [WebMethod(EnableSession = true)]
        public static object CategoryList()
        {
            var categories = AdminCategoryManager.GetCategories();
            return new { Result = "OK", Records = categories };
        }

        #endregion
    }
}